Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪟 🔧 Prevent rerendering on stale queries #17106

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

timroes
Copy link
Collaborator

@timroes timroes commented Sep 23, 2022

What

This prevents react-query from rerendering a component that uses a react-query hook in case the query turns stale. Since there is no new data we're not needing to rerender components in this case, especially since we have nowhere any specific logic that would require to detect whether a query is stale.

This will prevent some nasty rerenders e.g. of the connection listing page, that will always rerender twice (once for new data and then once for the stale query), which causing some hickups with the switch loading animation if you toggle connections to quickly.

How to test?
You can check that e.g. the connection list page (or any other page that has queries that turn stale) is not rerendering twice via the React dev tools. There should be no other affect than that.

@timroes timroes requested a review from a team as a code owner September 23, 2022 17:47
@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Sep 23, 2022
Copy link
Contributor

@krishnaglick krishnaglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, did not see a re-render on connections page after load. LGTM

@timroes timroes merged commit caa03fd into master Sep 23, 2022
@timroes timroes deleted the tim/disable-stale-rerendering branch September 23, 2022 19:53
robbinhan pushed a commit to robbinhan/airbyte that referenced this pull request Sep 29, 2022
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants